package com.erp.controller;

import com.erp.dto.LogDTO;
import com.erp.dto.resp.LogStats;
import com.erp.dto.resp.LogUnameStats;
import com.erp.dto.resp.LogUrlStats;
import com.erp.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@CrossOrigin
public class LogController {
    @Autowired
    private LogService logService;

    //日志列表
    @PostMapping("/listLogs")
    public Map<String,Object> listLogs(@RequestBody LogDTO log){

       return logService.queryLogListServiceV2(log.getPageNum(),log.getPageSize(),log);

    }
    @GetMapping("/queryLogListStats")
    public LogStats queryLogListStats(){
        return logService.queryLogListStats();
    }
    @GetMapping("/queryLogListUrlStats")
    public LogUrlStats queryLogListUrlStats(){
        return logService.queryLogListUrlStats();
    }
    @GetMapping("/queryLogListUnameStats")
    public LogUnameStats queryLogListUnameStats(){
        return logService.queryLogListUnameStats();
    }

}
